<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
<!--

$(document).ready(function(){
	editable();
	checkboxPlugin.init("alertInfo");
});

function editable(){
	var editable = ${editable};
	if(editable==false){
		 alertMsg.error('对不起，不能修改他人的或已发出的提醒！',{okCall:function(){
			  navTab.closeCurrentTab();
			  }});
		}
	
}
//-->
</script>
<div class="page">
	<div class="pageContent">
		<form id="alertInfo" method="post" action="${ctx }/crm/alert!save.action" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone);">
			<input type="hidden" name="id" value="${id }"/>
			<input type="hidden" name="navTabId" value="alertList"/>
			
			<security:authorize ifAllGranted="短信提醒">
			<input type="hidden" value="${smsalert }" name="smsalert" id="smsalert">
			</security:authorize>
			<input type="hidden" value="${sysalert }" name="sysalert" id="sysalert">
			<input type="hidden" value="${loginalert }" name="loginalert"  id="loginalert">
			<div class="pageFormContent" layoutH="56">
				<div>
				<p style="width:50%">			
					<label>主 题：</label>
					<input name="topic"  class="required" type="text" size="60" value="${topic }" />
				</p>	
				<p>
					<label>提醒时间：</label>
					<input name="alerttime" id="alerttime"  class="required" type="text" size="30" value="<s:date name="alerttime" format="yyyy-MM-dd HH:mm"/>" />
					<a class="inputDateButton" href="#" onClick="WdatePicker({el:'alerttime',dateFmt:'yyyy-MM-dd HH:mm:ss'})">选择</a>
				</p>	
				</div>
				<div>
				<p class="textareaBar" style="width:50%">
					<label>提醒内容：</label>
					<textarea rows="5" cols="50" class="required" id="main" name="summary">${summary }</textarea>
				</p>
				<p>
					<label>提醒方式：</label>
					<security:authorize ifAllGranted="ROLE_短信提醒">
					<input type="checkbox" value="1/2" id="smsalert_check" />短信定时提醒 
					</security:authorize>
					<input type="checkbox" value="1/2" id="sysalert_check" />系统定时提醒 
					<input type="checkbox" value="1/2" id="loginalert_check" />登录提醒  

				</p>	
				
				</div>
				
				<p class="textareaBar" style="width:50%">				

					<label>日程内容：</label>
					<textarea rows="10" cols="50" name="description" id="description" >${description}</textarea>
				</p>	
				<p>
					<label>提醒类型：</label>
					<s:if test="self==2">
						<input type="radio" value="1" name="self">个人提醒 
						
						<security:authorize ifAllGranted="ROLE_公司提醒">
						<input type="radio" value="2" checked="checked"  name="self">公司提醒 
						</security:authorize>
					</s:if>
					<s:else>
						<input type="radio" value="1" checked="checked" name="self">个人提醒 
						<security:authorize ifAllGranted="ROLE_公司提醒">
						<input type="radio" value="2"   name="self">公司提醒 
						</security:authorize>
					</s:else>
					
					
				</p>	

				<p>
					<label>创建者：</label>
					<s:if test="userid!=null">
					<input name="userid" class="required" type="hidden" size="30" value="${userid }" />
					<input name="username" class="required" type="text" size="30" value="${username }" />			
					</s:if>
					<s:else>
					<input name="userid" class="required" type="hidden" size="30" value="${currUser.id }" />
					<input name="username" class="required" type="text" size="30" value="${currUser.name }" />
					</s:else>
				</p>
				
				<p>
				<label>更新时间：</label>
				<input name="updatedate"  class="required" type="text" size="30" value="<s:date name="updatedate" format="yyyy-MM-dd HH:mm:ss"/>" />
				</p>
				
			</div>
			<div class="formBar">
				<ul>
					<!--<li><a class="buttonActive" href="#"><span>保存</span></a></li>-->
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="Button" onclick="navTab.closeCurrentTab()">取消</button></div></div>
					</li>
				</ul>
			</div>
		</form>
	</div>
</div>